package com.example.cv.service;

import com.example.cv.model.Candidate;
import com.example.cv.model.Employer;
import com.example.cv.model.Position;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 周杰
 */
@Transactional(rollbackFor = Exception.class)
public interface EmployerService {
    /**
     * description:用人单位查询
     * @param employer
     * @return：com.example.cv.model.Employer
     */
    Employer findEmployer(Employer employer);

    /**
     * description:用人单位注册（插入）
     * @param employer
     * @return boolean
     */
    boolean addEmployer(Employer employer);

    /**
     * description:查询所有求职者
     * @param
     * @return java.util.List<com.example.cv.model.Employer>
     */
    List<Candidate> findAllCandidates();

    /**
     * description:用人单位根据喜好动态查询求职者
     * @param candidate
     * @return java.util.List<com.example.cv.model.Employer>
     */
    List<Candidate> findCandidatesByParams(Candidate candidate);

    /**
     * description:根据id查询用人单位
     * @param e_id
     * @return com.example.cv.model.Employer
     */
    Employer findEmployerById(int e_id);

    /**
     * description:更新用人单位发布时间
     * @param position
     * @return boolean
     */
    boolean updatePosReleaseTime(Position position);

    /**
     * description:用人单位撤销发布信息
     * @param position
     * @return boolean
     */
    boolean deletePosReleaseTime(Position position);

    /**
     * description:用人单位更新企业信息
     * @param employer
     * @return java.lang.boolean
     */
    boolean updateEmployer(Employer employer);

    List<Candidate> findRecommendCandidates(int e_id);

    List<Position> findAllPositionsByEId(int e_id);

    List<Position> findPositionsByName(int e_id, String pos_name);

    boolean addPosition(Position position);

    Position findPositionByPId(int p_id);

    boolean updatePosition(Position position);

    boolean deletePosition(int p_id);
}
